/*
 * ExecutionProxy.h
 * Behavioral Attributed Automaton
 * @author Gregoire JACOB (gregoire.jacob@orange-ftgroup.com)
 * @date 14/05/2008
 * @version 2.2
 * Execution parser automaton
 */

//Set of parallel automata for activity
struct PARALLEL_AUTOMATA execution;

//Set of combinatory (avoid duplicated graph)
#define EOBJECTNB 20000
//long ExeObjectCombin[EOBJECTNB]; //Contains pointers for combination tables
char ExeObjectCombin[EOBJECTNB][EOBJECTNB];
char ExeVariableCombin[EOBJECTNB][EOBJECTNB];

/**
 * initExecutionAutomata()
 * Initialize the set of parallel automata as unique
 * automaton in a starting state
 */
void initExecutionAutomata();

/**
 * parseIntermediateRules()
 * @param the first argument identifier
 * @param the first argument type		
 * @param the second argument identifier	
 * @param the second argument type	
 * Parse the given rules and updates the automata
 * satisfying the syntactic and semantic rules
 */
void parseExeCreate(long argid, int argtype);
void parseExeOpen(long argid, int argtype);
void parseExeExecute(long argid, int argtype);
void parseExeRead(long arg1id, int arg1type, long arg2id, int arg2type);
void parseExeWrite(long arg1id, int arg1type, long arg2id, int arg2type);

/**
 * updateExecutionAutomata()
 * @param the current operation
 * @param the first argument identifier		(optional (0))
 * @param the first argument type			(optional (0))
 * @param the second argument identifier	(optional (0))
 * @param the second argument type			(optional (0))
 * Updates the progression of the different automata according
 * to the current lexical unit. May start new automaton
 */
void updateExecutionAutomata(unsigned long operation,
							long arg1id, int arg1type,
							long arg2id, int arg2type);